<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script>
			var rightname="dufengling";
			var rightpwd="123456";
			var rightcode=Math.floor(Math.random()*9000)+1000;
			var inputname=prompt("请输入用户名");
			if(inputname==rightname)
			{
				var inputpwd=prompt("请输入密码")
				if(inputpwd==rightpwd){
					var inputcode=prompt("请输入验证码"+rightcode);
					if(inputcode==rightcode){
						alert("登录成功");
					}else{alert("验证码错误")}
				}
				else{
					alert("密码错误");
				}
			}
			else{alert("用户名错误");}
		</script>
	</body>
</html>
